program q1113;
var
    a, b, i, max, ans, t: integer;
begin
    assign(input, '');
    assign(output, '');
    reset(input);
    rewrite(output);

    max := 0;
    for i:=1 to 7 do begin
        readln(a, b);
        t := a + b;
        if (t > max) then begin
            max := t;
            ans := i;
        end;
    end;

    writeln(ans);

    close(input);
    close(output);
end.
